<!doctype html>
<title>Try opening a protected file test</title>
<script>
  async function createAndCloseFile() {
    if (storageFoundation) {
      const test_file = await storageFoundation.open('test_file');
      await test_file.close();
      return true;
    } else {
      return false;
    }
  }
  async function tryOpeningFile() {
    try {
      await storageFoundation.open('test_file');
    } catch (e) {
      return e.name;
    }
    return '';
  }
</script>
